package com.hcmu.networklibs.rss;

import java.util.ArrayList;
import java.util.List;


/**
 * @author Glenn Bech
 */
public class HttpFeedSource implements FeedSource {

	//static final String URL = "http://www.webpronews.com/feed";
    //protected static final String URL = "http://cuoi.xitrum.net/truyencuoi.xml";
	protected   static final String URL = "http://www.camcuoi.com/truyen-cuoi-hai-huoc.feed?type=rss";
    
    /*public List<StoryRssDTO> getFeed() {
        List<StoryRssDTO> itemList = new ArrayList<StoryRssDTO>();

        RSSParser parser = new RSSParser(URL);
        parser.parse();
        RSSFeed feed = parser.getFeed();

        
        for (RSSItem i : feed.getItems()) {
            itemList.add(new StoryRssDTO(i.getDescription(), i.getTitle()));
        }
        
        return itemList;
    }*/
    
    public ArrayList<RSSItem> getFeed() {
        RSSParser parser = new RSSParser(URL);
        parser.parse();
        RSSFeed feed = parser.getFeed();

        ArrayList<RSSItem> rssItems = feed.getItems();
        
        return rssItems;
    }

	@Override
	public RSSItem getSimpleRSSItem() {
		
		return null;
	}
}
